<template>
	<div class="basicQiye"> 
		<!-- 企业信息照片 -->
		<div class="basicQiye_img">
			<img src="../../../public/images/enterprise/qyxx@2x.png" >
		</div>
		<div class="basicQiye_form">
			<!-- 表格对应的4个圆点 -->
			<div class="lineRadius l1"></div>
			<div class="lineRadius l2"></div>
			<div class="lineRadius r1"></div>
			<div class="lineRadius r2"></div>
			<!-- 企业信息表格 -->
			<table class="ntable" border="1">
				<tr>
					<td width="18%" class="tb">统一社会信用代码 </td>
					<td colspan="" class="copy-hover-item">{{baseData.uni_code|datum}}</td>
					<td width="13%" class="tb">法定代表人</td>
					<td width="20%" class="copy-hover-item">{{baseData.legal_rep|datum}}</td>
					<td width="13%" class="tb1">登记状态</td>
					<td width="20%">{{baseData.business_state|datum}}</td>
				</tr>
				<tr>
					<!-- <td width="13%" class="tb1">曾用名</td>
					<td class="base-opertd">{{baseData.company_name}}</td> -->
					
					<td width="13%" class="tb1">登记机关</td>
					<td width="20%">{{baseData.register_org|datum}}</td>
					<td class="tb">成立日期</td>
					<td>{{baseData.found_date |dateParse|datum}}</td>
					<td class="tb">注册资本</td>
					<td>{{baseData.regcapital_amt|datum}}万元人民币</td>
				</tr>
				<tr>
					<td class="tb1">核准日期</td>
					<td class="copy-hover-item">{{baseData.issuance_date|datum}}</td>
					<td class="tb1">营业期限</td>
					<td class="copy-hover-item">{{baseData.end_date|datum}}</td>
					<td class="tb1">人员规模 </td>
					<td class="copy-hover-item">{{baseData.company_size|datum}}人</td>
				</tr>
				<tr>
					<td class="tb">注册地址</td>
					<td colspan="5" class="copy-hover-item">{{baseData.reg_address|datum}}</td>
				</tr>
				<!---->
				<tr>
					<td class="tb1">经营范围</td>
					<td colspan="5" style="-webkit-line-clamp: 2;overflow: hidden;">{{baseData.business_scope|datum}}</td>
				</tr>
			</table>
		</div>
	</div>
</template>

<script>
	export default{
		data() { 
			return{
				sbcompany:'',
				baseData:[]
			}
		},
		mounted() {
			this.getBasedata()
			this.sbcompany=this.$route.query.comname
			this.$bus.$on('updateComname',async (comname)=>{
				this.baseData={
							"end_date": "",
							"describer": "",
							"issuance_date": "",
							"max": "",
							"reg_address": "",
							"regcapital_amt": 0,
							"is_list": "",
							"legal_rep": "",
							"business_scope": "",
							"homeurl": "",
							"uni_code": "",
							"update_time": "",
							"register_org": "",
							"field": "",
							"qualified_name": "",
							"phone": "",
							"company_name": "",
							"iconurl": "",
							"business_state": "",
							"found_date": "",
							"company_size": ""
					}
				this.sbcompany=comname
				this.getBasedata()
			})
		},
		filters:{
			dateParse(dataString){
				/* 过滤器 */
			    if (dataString) {
			        let date = new Date(dataString);
			        let Y = date.getFullYear() + '-';
			        let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
			        let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
			        return Y + M + D ;
			    } else {
			        return '';
			    }
			},
			datum(value) {
			      if(value){
					  return value
				  }else{
					  return '--'
				  }
			    },
		},
		methods:{ 
			// 获取企业信息数据
			async getBasedata(){
				
				var dt = {
					"params": {
						"normGuid": "b55cbf6d-df81-46fb-93d7-7678bd089471",
							"fieldList": [{
					            "key":"company_name",
					            "value":this.sbcompany
					        }]
					}
				};
				const aaa = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dt)
				let {custom:{result}}={...aaa}
				this.baseData=result.cockpitData[0]
			},
		}
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/basicQiye.styl"
</style>
